package biz.alla.market.domain;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "category")
public class Category implements Serializable {
    private static final long serialVersionUID = 6588424329223342191L;
    private int id;
    private String name;

    private Set<SubCategory> subCategories;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public int getId() {
	return id;
    }

    public void setId(int id) {
	this.id = id;
    }

    public String getName() {
	return name;
    }

    public void setName(String name) {
	this.name = name;
    }

    @OneToMany(mappedBy = "category")
    public Set<SubCategory> getSubCategories() {
	return subCategories;
    }

    public void setSubCategories(Set<SubCategory> subCategories) {
	this.subCategories = subCategories;
    }
}
